package org.ceteca.explica.server.installer;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.List;

import org.ceteca.explica.core.installer.Installer;
import org.ceteca.explica.core.installer.ResourceException;

public class InstallerImpl extends UnicastRemoteObject implements Installer {
	private static final long serialVersionUID = 123456789;
	public InstallerImpl() throws RemoteException {
		super();
	}
	public List getResourcesList() throws RemoteException, ResourceException {
		return ResourceLN.getInstance().getAllResources();
	}
	
	public Integer getLatestVersion(String codResource) throws RemoteException, ResourceException {
		return ResourceLN.getInstance().getLatestVersion(codResource);
	}
	
	public byte[] getResource(String codResource) throws RemoteException, ResourceException {
		return ResourceLN.getInstance().loadResource(codResource);
	}
	
	public boolean isUpdated(String codResource, Integer currentVersion) throws RemoteException, ResourceException {
		return ResourceLN.getInstance().isResourceUpdated(codResource, currentVersion);
	}
	public List getAreasList() throws RemoteException, ResourceException {
		return ResourceLN.getInstance().getAllAreas();
	}
}
